import { ref } from 'vue'
import { enableOptions } from 'config/mockData'
import { ERR_OK } from 'config/statusCode'
import { getTenantId } from 'utils/headerToken'
import { useI18n } from 'vue-i18n'

 
// 我提交的
export function getISubmittedSearchData() {
  const { t } = useI18n() // 中英文
  return [
    {
      field: 'ticketCode',
      label: t('keys.docment_code'),
      component: 'Input'
    },
    {
      field: 'ticketName',
      label: t('keys.docment_name'),
      component: 'Input'
    }, 
    {
      field: 'docConfigCode',
      label:  t('keys.docConfigCode'),
      component: 'pageSelect',
      componentProps: {
        // 业务单据下拉框
        clearable: true,
        disabled: false,
        assignment: 'docConfigCode',
        keyName: 'docConfigName',
        keyValue: 'docConfigCode',
        opsName: '', //  编辑回显list数据option的key的值
        opsValue: '', // 编辑回显list数据option的value的key的值
        Url: `/zwkf/v1/${getTenantId()}/doc-config`,
        disabledOptions: [],
        params: {
          // // 接口传值请求分页query数据
          docConfigName: ''
        }
      }
    },
    {
      field: 'nodeName',
      label: t('keys.Current_Approval_Node'),
      component: 'Input'
    },
    {
      field: 'approval',
      label:   t('keys.Current_approver'),
      component: 'Input'
    },
    {
      field: 'createTime',
      label: t('keys.apply_request_time'),
      component: 'DateTimeRange'
    },
    {
      field: 'status',
      label: t('keys.status'),
      component: 'Select',
      lovCode: 'ZWFK.INSTANCE_STATUS',
      component: 'Select'
    }
  ]
}
// 抄送我的
export function getccToMeSearchData() {
  const { t } = useI18n() // 中英文
  return [
    {
      field: 'ticketCode',
      label: t('keys.docment_code'),
      component: 'Input'
    },
    {
      field: 'ticketName',
      label: t('keys.docment_name'),
      component: 'Input'
    },
    {
      field: 'docConfigCode',
      label:  t('keys.docConfigCode'),
      component: 'pageSelect',
      componentProps: {
        // 业务单据下拉框
        clearable: true,
        disabled: false,
        assignment: 'docConfigCode',
        keyName: 'docConfigName',
        keyValue: 'docConfigCode',
        opsName: '', //  编辑回显list数据option的key的值
        opsValue: '', // 编辑回显list数据option的value的key的值
        Url: `/zwkf/v1/${getTenantId()}/doc-config`,
        disabledOptions: [],
        params: {
          // // 接口传值请求分页query数据
          docConfigName: ''
        }
      }
    },
    {
      field: 'initiator',
      label:  t('keys.initiatorName'),
      component: 'Input'
    },
    {
      field: 'createTime',
      label: t('keys.apply_request_time'),
      component: 'DateTimeRange'
    },
    {
      field: 'approval',
      label: t('keys.Current_approver'),
      component: 'Input'
    },
    {
      field: 'nodeName',
      label: t('keys.Current_Approval_Node'),
      component: 'Input'
    },
    {
      field: 'status',
      label:  t('keys.status'),
      component: 'Select',
      lovCode: 'ZWFK.INSTANCE_STATUS',
      component: 'Select'
    }
  ]
}
// 已审批
export function getapprovedSearchData() {
  const { t } = useI18n() // 中英文
  return [
    {
      field: 'ticketCode',
      label: t('keys.docment_code'),
      component: 'Input'
    },
    {
      field: 'ticketName',
      label: t('keys.docment_name'),
      component: 'Input'
    },
    {
      field: 'docConfigCode',
      label:  t('keys.docConfigCode'),
      component: 'pageSelect',
      componentProps: {
        // 业务单据下拉框
        clearable: true,
        disabled: false,
        assignment: 'docConfigCode',
        keyName: 'docConfigName',
        keyValue: 'docConfigCode',
        opsName: '', //  编辑回显list数据option的key的值
        opsValue: '', // 编辑回显list数据option的value的key的值
        Url: `/zwkf/v1/${getTenantId()}/doc-config`,
        disabledOptions: [],
        params: {
          // // 接口传值请求分页query数据
          docConfigName: ''
        }
      }
    },
    {
      field: 'initiatorName',
      label: t('keys.initiatorName'),
      component: 'Input'
    },
    {
      field: 'createTime',
      label: t('keys.apply_request_time'),
      component: 'DateTimeRange'
    },
    {
      field: 'currentApprovalName',
      label: t('keys.Current_approver'),
      component: 'Input'
    },
    {
      field: 'status',
      label: t('keys.status'),
      component: 'Select',
      lovCode: 'ZWFK.INSTANCE_STATUS',
      component: 'Select'
    }
  ]
}
// 待审批
export function gettoBeApprovedSearchData() {
  const { t } = useI18n() // 中英文
  return [
    {
      field: 'ticketCode',
      label: t('keys.docment_code'),
      component: 'Input'
    },
    {
      field: 'ticketName',
      label: t('keys.docment_name'),
      component: 'Input'
    },
    {
      field: 'docConfigCode',
      label:  t('keys.docConfigCode'),
      component: 'pageSelect',
      componentProps: {
        // 业务单据下拉框
        clearable: true,
        disabled: false,
        assignment: 'docConfigCode',
        keyName: 'docConfigName',
        keyValue: 'docConfigCode',
        opsName: '', //  编辑回显list数据option的key的值
        opsValue: '', // 编辑回显list数据option的value的key的值
        Url: `/zwkf/v1/${getTenantId()}/doc-config`,
        disabledOptions: [],
        params: {
          // // 接口传值请求分页query数据
          docConfigName: ''
        }
      }
    },
    {
      field: 'initiatorName',
      label:  t('keys.initiatorName'),
      component: 'Input'
    },
    {
      field: 'createTime',
      label: t('keys.apply_request_time'),
      component: 'DateTimeRange'
    },
    {
      field: 'taskSource',
      label: t('keys.Process_Source'),
      lovCode: 'ZWFK.APPROVE_SOURCE',
      component: 'Select'
    }
  ]
}
